<?php
/**
 *  获取 运单号
 * Created by wzb.
 * User: wzb
 * time:2019/03/07
 */
require("/home/ryerp_api/magento/Autoloader_d.php");
class ByorderidGettracknumber extends Common
{

public function cront($orderid=''){
        $url="http://47.244.235.129/apiorder/Byorderidgettracknumber/byorderid?orderid=$orderid";
        echo $url."\n";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
	      curl_setopt($ch, CURLOPT_TIMEOUT,60);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $response = curl_exec($ch);
        $data = json_encode($response);
        print_r($response);
        curl_close($ch);
        return;
}



public function getorders(){
      $orderids = $this->getorderid();
      foreach ($orderids as $key => $value) {
         $orderid = $value['increment_id'];
        echo $orderid."\n";
         $this->cront($orderid);
      }
      exit;
  }
}

$ByorderidGettracknumber = new ByorderidGettracknumber();

$ByorderidGettracknumber->getorders();
